using System.Web.Mvc;
using Xunit;
using YBBEST.Office365Portal.Core;
using YBBEST.Office365Portal.MvcWebRole.Controllers;

namespace YBBEST.Office365Portal.WebTests
{
    public class ListControllerTests
    {

        [Fact]
        public void BrowseToControllerIndexActionRetrieveAllListsWasCalled()
        {
            MockListRepository repository = new MockListRepository();
            ListController listController = new ListController(repository);
            listController.Index();
            Assert.True(repository.RetrieveAllListsWasCalled);
        }

        [Fact]
        public void BrowseToControllerCreateActionCreateListWasCalled()
        {
            MockListRepository repository = new MockListRepository();
            ListController listController = new ListController(repository);
            FormCollection formCollection = new FormCollection();
            listController.Create(formCollection);
            Assert.True(repository.CreateListWasCalled);
        }

    }
}


